package com.baizhi.appcontroller;

import com.baizhi.entity.CmfzAlbum;
import com.baizhi.service.CmfzAlbumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: renpu
 * @Date: 2019/3/6 21:44
 * @Description:
 */

@RestController
@RequestMapping("/AppAlbum")
public class AppAlbumController {

    @Autowired
    private CmfzAlbumService albumService;

    @GetMapping("bestNewAlbum")
    public List<CmfzAlbum> bestNewAlbum(){
        return albumService.selectBestAlubm();
    }

    @GetMapping("selectAudioId/{id}")
    public CmfzAlbum selectAudioId(@PathVariable("id") int id){
        return albumService.selectAudioId(id);
    }

    @GetMapping("selectOneAlbum/{id}")
    public CmfzAlbum selectOneAlbum(@PathVariable("id") int id){
        return albumService.selectOneAlbum(id);
    }

    @GetMapping("selectAlbumAll")
    public List<CmfzAlbum> selectAlbumAll(){
        return albumService.selectAlbumAll();
    }
}
